package com.nextStep.service;

import com.nextStep.entity.DbConfig;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public interface DbExecuteService {
    //查询所有数据表
    public List showTables(DbConfig dbConfig) ;

    //查询表内容
    public List selectTable(DbConfig dbConfig,String tableName,Integer pageNum,Integer pageSize) ;

    //查询表列名
    public List selectColumns(DbConfig dbConfig,String tableName) ;

    //显示数据的分页页面总数
    public Integer selectLimitSumNum(DbConfig dbConfig, String tableName, Integer pageSize) ;

    //根据条件查询表内容,包括表列名
    public List condTable(DbConfig dbConfig,String tableName,String selectColumns, String dataSelectInput ) ;


    //根据id删除数据
    public int deleteData(DbConfig dbConfig,String tableName,String idValue) ;

    //根据参数查询某行数据
    public List<List> updateRow(DbConfig dbConfig,String tbName,String rowIdValue);

    public void test();

    //修改  修改数据库数据
    public int updateRowData(DbConfig dbConfig, String tbName, String[] arrId, String[] arrValue);

    //插入数据
    public Integer addRow(DbConfig dbConfig, String tbName, String[] arrId, String[] arrValue);

    //测试数据库配置是否正确
    public boolean dbconfigTest(DbConfig dbConfig);

    //执行sql语句
    public List<List> runSql(DbConfig dbConfig,String sql) ;

}
